<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>无标题文档</title>
        <style>
            td{
                text-align: center;
            }
            .edit_a,.delete{
                color:#000000;
                text-decoration:none;
            }
            .img{
               
            }
        </style>
    </head>

    <body>
        <div align="center">
            <table class='table' width="698" height="142" border='1px' cellspacing="0px" style="border-color:#FFD39B">
                <tbody>
                    <tr style='background:#FFD39B'>
        <td width="24" height="21">ID</td>
        <td width="40">姓名</td>
        <td width="80">所属部门</td>
        <td width="60">头像</td>
        <td width="187">出生日期</td>
        <td width="183">入职时间</td>
        <td width="127">相关操作</td>
      </tr>
                    <?php
                    require_once 'data/db_emp_conn.php';
                    $sql = 'select * from student';
                    $result = $conn->query($sql);
                    ?>
                    <?php if ($result->num_rows > 0): ?>
                        <?php
                        $rows = $result->fetch_all(MYSQLI_ASSOC);
                        foreach ($rows as $row): ?>
                            <tr>
                                <td height="43"><?php echo $row['ID']; ?></td>
                                <td><?php echo $row['name']; ?></td>
                                <td><?php echo $row['department']; ?></td>
                                <td height="65px"><img src=<?php echo 'images/1.jpg';?>></td>
                                <td><?php echo $row['Date of birth']; ?></td>
                                <td><?php echo $row['Entry date']; ?></td>
                                <td><a class="edit_a" href="javascript:" onclick="if(confirm('确定修改吗？')) location.href='#'" >修改</a>
                                    <a class="delete" href="javascript:" onclick="if(confirm('确定删除吗？')) location.href='#'" >删除</a>
                                </td>
                               
                            </tr>
                        <?php endforeach; ?>
                    <?php else : ?>
                    <p>0 个结果额</p>
                <?php endif; ?>
                </tbody>
            </table>
        </div>
    </body>
</html>
